'use strict';

angular.module('com.dcos.app').factory('TemplateService', function ($http) {
	return {
		list: function (project_id) {
	      return $http({
	        method: 'POST',
	        url:'/v1/template/querylist',
	        data:JSON.stringify({project_id:project_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		delete: function (t_id) {
	      return $http({
	        method: 'DELETE',
	        url:'/v1/template/delete',
	        data:JSON.stringify({t_id:t_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		getPipelineList: function (project_id) {
	      return $http({
	        method: 'POST',
	        url:'/v1/api/listjob',
	        data:JSON.stringify({project_id:project_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
	    saveByPipeLine: function (data) {
	      return $http({
	        method: 'POST',
	        url:'/v1/template/argsave',
	        data:JSON.stringify(data),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
	}
});
